home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 November
/
Pcwk1197.iso
/
LOTUS
/
Eng-ins
/
ACROREAD
/
SUITE
/
DW08_S6.APR
/
SCRIPT
/
ApproachDoc
/
Report 2.s
(
.txt
)
< prev
next >
Wrap
Null Bytes Alternating
|
1996-10-27
|
4KB
|
56 lines
'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Switchto(Source As Report, View As VIEW)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As REPORT
Set Source = Bind(Objectname_)
On Event Switchto From Source Call Switchto
End Sub
'++LotusScript Development Environment:2:2:Switchto:1:12
Sub Switchto(Source As Report, View As VIEW)
' SwitchTo event for a report object
' * RUNTIME DEPENDENCIES
' * Files: The report that the script is attached to is a summary
' * report with a group-by field.
Dim MyGrp As String ' Store user input.
Dim Flag As Integer ' Indicates successful field name entry.
' Go to the Browse environment.
CurrentApplication.ApplicationWindow.DoMenuCommand(IDM_browse)
' Prompt the user for the field name by which the user wants to
' group records.
Flag = 1
While Flag = 1
MyGrp = Inputbox$("What do you want to group by? (Date, Invoice, RepID)" _
&Chr(10)&Chr(13)&"Date"&Chr(10) _
&"Invoice", "Grouping", "Date", 300, 300)
If MyGrp <>"Invoice" And MyGrp<>"RepID" And MyGrp<>"Date" Then
Flag = 1
Beep
Messagebox "Invalid Group Field." & Chr(13) & _
"Try Again.",0+48+0+0, "Invalid Entry"
Else
Flag = 0
End If
Wend
' Change the current summary panels (leading and trailing) to
' reflect the new grouping.
Source.Summary.GroupByDataField = MyGrp
Source.Summary.MyLPanelFld.Datafield = MyGrp
Source.Summary.MyLPanelFld.LabelText = MyGrp
' Go to Print Preview so that the user is prompted to sort on
' the new grouping and can see the results.
CurrentApplication.ApplicationWindow.DoMenuCommand(IDM_Preview)
End Sub